<%@page import="articles.string.Replace"%>
<%@page import="java.util.List"%>
<%@page import="articles.model.Category"%>
<%@page import="articles.data.QnAPersistenceManager"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="javax.jdo.Query"%>
<%
	//get list category
	PersistenceManager psm = QnAPersistenceManager.get().getPersistenceManager();
	Query query_category = psm.newQuery(Category.class);
	query_category.setOrdering("order ASC");
	@SuppressWarnings("unchecked")
	List<Category> list_category = (List<Category>) query_category.execute();
%>

<div class="list">
	<ul class="child_list">
		<li class="one">menu do site</li>
		<li><a href="/" title="casa">casa</a></li>
		<li><a href="/search" title="pesquisa google">pesquisa</a></li>
		<li><a href="/archives" title="arquivo">arquivo</a></li>
		<li><a href="/submit-articles" title="Enviar um artigo">Enviar um artigo</a></li>
		<li><a href="/rss" title="Mais recentes artigos (rss)">Mais recentes artigos (rss)</a></li>
	</ul>
	<ul class="child_list">
		<li class="one">categoria</li>
		<%
			if (list_category.size()>0)
			{
				for(int i=0;i<list_category.size();i++)
				{
					out.println("<li><a href=\"/category/"+list_category.get(i).getAlias()+"\" title='Category "+Replace.remove(list_category.get(i).getName())+"'>"+list_category.get(i).getName()+"</a></li>");
				}
			}
		%>
	</ul>
</div>